package com.jerry.spring.security.jwt.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试controller
 *
 * @author jerry 2024/5/8 15:08
 */
@RestController
public class HelloController {

    @RequestMapping("/hello")
    @PreAuthorize("hasAnyAuthority('sys:test:list')")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/custom")
    @PreAuthorize("@se.hasAnyAuthority('sys:test:add', 'sys:test:list')")
    public String custom() {
        return "custom";
    }

    @RequestMapping("/test")
    public String test() {
        return "custom";
    }
}
